package com.pan.show.record.impl;

import com.pan.show.record.Record;

import java.util.concurrent.atomic.AtomicInteger;

public class CommandLineRealTimeRecord implements Record<String> {

    private AtomicInteger flag = new AtomicInteger(1);


    @Override
    public void setContent(String content) {
        while (!flag.compareAndSet(1,0));
        System.out.println(content);
        while (!flag.compareAndSet(0,1));
    }

    @Override
    public void display() {

    }

    @Override
    public void close() {

    }
}
